package cn.ztydata.teachingsystem.heaven.web.dto.exercise;

import cn.ztydata.teachingsystem.heaven.web.dto.KpDto;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 习题信息Dto类
 * Created by wyh on 2015/2/4.
 */
public class ExerciseDetailDto {
    @Min(value = 1, message = "ID不合法")
    private Long id; //ID

    @NotEmpty(message = "题干不合法")
    private String question; //题干

    private String title; //列表题干（没有html标签）

    @NotNull(message = "题型不合法")
    @Range(min = 1, max = 7, message = "题型不合法")
    private Integer type; //题型（1：单选；2：多选；3：判断题；4：填空；5：简答题；6 ：阅读理解 7：阅读理解多选）

    @NotNull(message = "分数不合法")
    @Range(min = 1, max = 100, message = "分数必须在0-100之间")
    private Long score; //分数

    @Min(value = 1, message = "专业ID不合法")
    private Long majorId; //专业ID

    @Range(min = 0, max = 1, message = "公开不合法")
    private Integer isOpen; //是否公开 0：不公开，1：公开

    @Range(min = 1, max = 5, message = "难度不合法")
    private Integer difficulty; //难度(1~5)

    @Range(min = 0, max = 3, message = "状态不合法")
    private Integer status; //习题状态

    @Valid
    @Size(max =3, message = "只能用1-3个提示")
    private List<ExerciseTipDto> tipList; //提示

    @Valid
    private List<ExerciseAnalysisDto> analysisList; //常规解析

    private List<Long> analysisResList; //资源解析

    private Integer analysisResCount; //引用解析数量

    @Size(min = 1, message = "知识点不合法")
    private List<KpDto>  knowledges; //知识点

    @NotNull(message = "附件下载地址不合法")
    @Length(max = 500, message = "地址长度不合法")
    private String downloadUrl; //附件下载地址，用于问答题或阅读理解（单题），不用时为""

    @Length(min = 1, max = 500, message = "地址长度不合法")
    private String showUrl; //附件显示地址，用于问答题或阅读理解（单题）

    @Length(max = 500, message = "文件名长度不合法")
    private String fileName; //附件文件名，，用于问答题或阅读理解（单题），不用时为""，子习题为null

    @Valid
    @NotNull(message = "填空不合法")
    private List<BlankDto> blanks; //空格集合，填空题时使用，不用时为null

    @Valid
    @NotNull(message = "选项不合法")
    private List<OptionDto> options; //选项集合，选择题、判断题时（数组长度为1）使用，不用时为null

    @Valid
    private List<ExerciseDetailDto> sonPraxises; //子习题集合，用于阅读理解（一题多问），不用时为null

    private Long praxisId;//习题编号

    private Long hot;//热度<=>使用次数author lyj
    private String accuracy;//正确率tuthor lyj

    private int son;//子题个数
    private int blankNum;//答案数

    private String creater; //创建者姓名

    public Long getHot() {
        return hot;
    }

    public void setHot(Long hot) {
        this.hot = hot;
    }

    public String getAccuracy() {
        return accuracy;
    }

    public void setAccuracy(String accuracy) {
        this.accuracy = accuracy;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getScore() {
        return score;
    }

    public void setScore(Long score) {
        this.score = score;
    }

    public Long getMajorId() {
        return majorId;
    }

    public void setMajorId(Long majorId) {
        this.majorId = majorId;
    }

    public Integer getIsOpen() {
        return isOpen;
    }

    public void setIsOpen(Integer isOpen) {
        this.isOpen = isOpen;
    }

    public Integer getDifficulty() {
        return difficulty;
    }

    public void setDifficulty(Integer difficulty) {
        this.difficulty = difficulty;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public String getShowUrl() {
        return showUrl;
    }

    public void setShowUrl(String showUrl) {
        this.showUrl = showUrl;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public List<ExerciseTipDto> getTipList() {
        return tipList;
    }

    public void setTipList(List<ExerciseTipDto> tipList) {
        this.tipList = tipList;
    }

    public List<ExerciseAnalysisDto> getAnalysisList() {
        return analysisList;
    }

    public void setAnalysisList(List<ExerciseAnalysisDto> analysisList) {
        this.analysisList = analysisList;
    }

    public List<Long> getAnalysisResList() {
        return analysisResList;
    }

    public void setAnalysisResList(List<Long> analysisResList) {
        this.analysisResList = analysisResList;
    }

    public List<KpDto> getKnowledges() {
        return knowledges;
    }

    public void setKnowledges(List<KpDto> knowledges) {
        this.knowledges = knowledges;
    }

    public List<BlankDto> getBlanks() {
        return blanks;
    }

    public void setBlanks(List<BlankDto> blanks) {
        this.blanks = blanks;
    }

    public List<OptionDto> getOptions() {
        return options;
    }

    public void setOptions(List<OptionDto> options) {
        this.options = options;
    }

    public List<ExerciseDetailDto> getSonPraxises() {
        return sonPraxises;
    }

    public void setSonPraxises(List<ExerciseDetailDto> sonPraxises) {
        this.sonPraxises = sonPraxises;
    }

    public Long getPraxisId() {
        return praxisId;
    }

    public void setPraxisId(Long praxisId) {
        this.praxisId = praxisId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public int getSon() {
        return son;
    }

    public void setSon(int son) {
        this.son = son;
    }

    public int getBlankNum() {
        return blankNum;
    }

    public void setBlankNum(int blankNum) {
        this.blankNum = blankNum;
    }

    public Integer getAnalysisResCount() {
        return analysisResCount;
    }

    public void setAnalysisResCount(Integer analysisResCount) {
        this.analysisResCount = analysisResCount;
    }

    public String getCreater() {
        return creater;
    }

    public void setCreater(String creater) {
        this.creater = creater;
    }
}
